package teleware.soe.core.dto;

import java.util.Arrays;
import java.util.List;

/**
 * rest操作
 *
 * @author :hongsw
 * @date :2020-12-03 17:48
 */
public class Operations {
    /**
     * 方法名称
     */
    private String name;
    /**
     * 方法参数
     */
    private List<String> parameters;
    /**
     * 输出格式
     */
    private List<String> supportedOutputFormats;
    /**
     * 是否仅支持post请求
     */
    private boolean postOnly;

    /**
     * 初始化构造函数
     *
     * @param name                   方法名称
     * @param parameters             方法参数
     * @param supportedOutputFormats 输出格式
     * @param postOnly               是否仅支持post请求
     * @author hongsw
     * @date 2020/12/7 15:58
     **/
    public Operations(String name, String[] parameters, String[] supportedOutputFormats, boolean postOnly) {
        this.name = name;
        this.parameters = Arrays.asList(parameters);
        this.supportedOutputFormats = Arrays.asList(supportedOutputFormats);
        this.postOnly = postOnly;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setParameters(List<String> parameters) {
        this.parameters = parameters;
    }

    public List<String> getParameters() {
        return parameters;
    }

    public void setSupportedOutputFormats(List<String> supportedOutputFormats) {
        this.supportedOutputFormats = supportedOutputFormats;
    }

    public List<String> getSupportedOutputFormats() {
        return supportedOutputFormats;
    }

    public void setPostOnly(boolean postOnly) {
        this.postOnly = postOnly;
    }

    public boolean getPostOnly() {
        return postOnly;
    }

}